home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Developer Toolbox 6.1
/
SGI Developer Toolbox 6.1 - Disc 4.iso
/
public
/
fax
/
src
/
util
/
typerules
< prev
next >
Wrap
Text File
|
1994-08-01
|
5KB
|
108 lines
#
# FlexFAX file type rules.
#
# This file contains the file typing rules used by the sendfax
# program to deduce how input files should be prepared for fax
# transmission. The format of this file is based on the System V
# /etc/magic file used by the file(1) program. The code that
# reads this file was written entirely based on the comments that
# exist at the top of the magic file and describe how it works.
# The use of magic-style rules is intended to make it easier for
# users to reuse rules already designed for use with file(1).
#
# Each entry defines a type rule. Entries normally are terminated
# by the end of a line, thought they can be continued across lines
# with a ``\'' (when this is done leading white space is converted
# to a single space). ``#'' is a comment character; when it appears
# on a line, everything to the right is ignored.
#
# The fields in each entry are:
#
# offset: a byte offset in the file at which data should be extracted
# and compared to a matching string or value. If this value
# begins with '>', then an additional rule is used and scanning
# continues to the next type rule line that does not begin with
# a '>'.
# datatype: the type of data value to extract the specified offset in the
# for comparison purposes. This can be byte, short, long, or
# string (a not necessarily null-terminated string of bytes).
# A byte is 8 bits, short 16 bits, and long 32 bits.
# match: the value and operation to use in matching; the value used is
# based on the datatype field. This value may be "x" to mean
# "match anything". The operation is "=" if nothing is specified;
# otherwise it can be one of ">", "<", "<=", ">=", "!=", "&"
# (for and-ing and comparing to zero), "^" (for xor-ing and
# comparing to zero), and "!" (for taking one's complement and
# comparing to zero).
# result: one of "PS", "TIFF, or "error" (case insensitive). The first
# two results specifiy whether the rule generates a PostScript
# file or a bilevel TIFF image. The "error" result indicates a
# file is unsuitable for transmission and if supplied as an
# argument to sendfax, the command should be aborted.
# rule: a string passed to the shell to convert the input file
# to the result format (suitable for sending as facsimile).
# The rule string is a printf-like string that should use the
# following "%" escapes:
# %i input file name
# %o output file name
# %r output horizontal resolution in pixels/mm
# %R output horizontal resolution in pixels/inch
# %v output vertical resolution in lines/mm
# %V output vertical resolution in lines/inch
# %f data format, 1 for 1-d encoding or 2 for 2-d encoding
# %w page width in mm
# %W page width in pixels
# %l page length in mm
# %L page length in inches
# %s page size by name
# %F the pathname of the fax library (e.g./usr/local/lib/fax)
# %<x> the <x> character (e.g. ``%%'' results in ``%''
#
# These are the "null rules"--i.e. for matching formats handled
# directly by the server.
#
#offset datatype match result rule
0 string %! ps
0 short 0x4d4d tiff
0 short 0x4949 tiff
#
0 short 000732 tiff %F/sgi2fax -%f -o %o -v %V\
-s %s %i
0 short 017436 error packed data
0 short 017635 error compressed data
#0 short 0x0506 ps showcase -p %i
0 short 0xf702 ps dvips -q -o %o %i
0 string GIF tiff
>3 string 87a tiff gif2tiff -%f -v %V %i %o
>3 string 89a error GIF (version 89a)
0 long 0x59a66a95 tiff ras2tiff -%f -v %V %i %o
#
# NB: psdit is the Adobe Transcript program for converting ditroff output
0 string x T psc ps psdit <%i >%o
#
# These are from the PBMPLUS package's auxiliary magic numbers file
# Most of these entries use the "string" format so that they will work on
# both big-endian and little-endian machines.
#
0 string begin error uuencoded file
0 string xbtoa error btoa'd file
0 string P1 error PBM file
0 string P2 error PGM file
0 string P3 error PPM file
0 string P4 error PBM "rawbits" file
0 string P5 error PGM "rawbits" file
0 string P6 error PPM "rawbits" file
#
0 string WNGZWZSS error Wingz spreadsheet
0 string #Inventor V error IRIS Inventor file
>15 string binary error binary IRIS Inventor file
>15 string ascii ps %F/textfmt -f Courier-Bold\
-p 11 -s %s >%o <%i
#
# This causes anything else with ascii-only data to be treated as text.
# Note that we use an explicit pathname for lptops because it might be
# installed elsewhere on the system and our version is very different.
#
0 ascii x ps %F/textfmt -f Courier-Bold\
-p 11 -s %s >%o <%i